// dlg.txt

begintalkscript;

variables;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(57,1) == 0;
	question = "special";
	text1 = "To get here, you had to walk through what felt like a mile of abandoned mining tunnels, narrow, natural crevices, and hallways hurriedly dug out by servile labor.";
	text2 = "It was a dark, tiring, uneventful journey, but now you have found something different. You are at the entrance to what looks like some sort of abandoned subterranean outpost. Shaper, judging from the tattered banner on the wall.";
	text3 = "No guards are on duty. Nobody greets you. There are no signs to tell you what you have found. There is, however, the smell of essence, and the air crackles with magical power.";
	text4 = "It is worrying. Shapers never leave magic and creations behind and unguarded without a good reason.";
	action = SET_SDF 57 1 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(57,2) == 0;
	question = "special";
	text1 = "To the south, you see a broad chamber with a low ceiling, held up by many pillars. It was once a massive workshop, where Shapers, technicians, and serviles worked together to make a variety of traps and machinery.";
	text2 = "Many of those traps, it appears, have been activated and left to defend the tunnel. You pay more attention, however, to the flock of wingbolts guarding the entrance. They are exceptionally large for their kind.";
	text3 = "They seem to be flying around a newly made pacification pylon. Conduits lead to it from the wall, but no power flows through them. The pylon is off. If it was active, it would be much easier to sneak past the wingbolts.";
	text4 = "They seem to be flying around a newly made pacification pylon. It is active. As long as you don't get too close to any wingbolts, you might be able to sneak past them.";
	action = SET_SDF 57 2 1;
	code =
		if (gf(57,14) > 0)
			rs(3);
			else rs(4);
	break;
	
begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(57,3) == 0;
	question = "special";
	text1 = "The broad gallery to the west looks like it is unused, except perhaps for storage. You can see blocks and other building materials nearby. Perhaps the Shapers had plans to expand and improve it.";
	text2 = "The tunnel isn't empty, though. It's full of creation patrols. You can see their spoor everywhere. They must have been wandering this cavern for months, without care or food. Some Shaper magic must be sustaining them.";
	text3 = "The tunnel offers few opportunities for concealment. If you walk too far this way, battle is inevitable.";
	action = SET_SDF 57 3 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(57,4) == 0;
	question = "special";
	text1 = "At last, you are in sight of the southern exit from this trapped complex. Hopefully, once through, you will be close to the other side of the mountains.";
	text2 = "However, one final sentinel stands between you and escape. It is a huge golem. It doesn't have the standard, lumpy shape, though. It has been carefully molded to look like a war trall.";
	text3 = "Its massive stone fists are covered with sharp points of rock, specially made to punish intruders. The stone plates covering its fleshy core are inscribed with many lines of powerful protective runes.";
	text4 = "It is, no doubt, blessed with all of the most powerful and cunning bits of Shaper magical trickery. Fighting it is bound to involve all sorts of fun surprises.";
	action = SET_SDF 57 4 1;

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = get_sdf(57,5) == 0 && gf(57,12) == 0;
	question = "special";
	text1 = "You cross some invisible line. There is a surge of magic in the air. Your hair stands slightly on end.";
	text2 = "Some powerful Shaper defenses have become active in the cavern ahead. You aren't sure what they are, but you suspect that, the longer they are allowed to operate unhindered, the worse it will be for you.";
	action = SET_SDF 57 5 1;

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = get_sdf(57,6) == 0 && gf(57,13) == 0;
	question = "special";
	text1 = "Once again, you feel the surge of magic in the air. There are probably more spawners down the hall, ready to bombard you with hostile creations.";
	action = SET_SDF 57 6 1;
	
begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This mine was never completed. It's inactive.";

begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = get_sdf(57,7) == 0;
	question = "special";
	text1 = "You are at the entrance to the power core of the complex. There is a huge, glowing, crystal spire in the center of the chamber.";
	text2 = "Conduits slowly leak power out of it, carrying the energy away to keep the defenses of the complex active. The Shapers were sure to fully charge it before they left. It looks like it has months of power left.";
	text3 = "There are six golems ringing the room. The sweltering heat in here doesn't seem to affect them. They stand there perfectly motionless. Their eyes are dim. They must be the dormant laborers of this outpost.";
	text4 = "Something about this situation, the golems, the blast doors, makes you suspicious. Could be another trap.";
	action = SET_SDF 57 7 1;
	
begintalknode 9;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Your suspicions of a trap were entirely founded. As you walk carefully through the power core, the door behind you slams shut.";
	text2 = "The golems raise their heads as one. Their eyes begin to glow. However, they don't move to attack you. Instead, they begin to move, very slowly, toward the crystal spire in the middle.";
	
begintalknode 10;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "A golem reaches the crystal spire. It reaches out its clumsy stone arms, touches the crystal, and begins to draw power from it. Almost immediately, the golem's rocky skin begins to glow red hot.";
	text2 = "The golem is drawing a lot of power. You aren't immediately sure why, but you suspect you won't like the answer.";
	
begintalknode 11;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You have done some serious damage to this golem. There are long cracks in its surface. It is no longer able to store power in its damaged state.";
	text2 = "It turns and begins to lumber back to where it started, probably to use the power within to restore itself.";
	
begintalknode 12;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "A golem has absorbed enough power. It begins to radiate it back out. The room immediately changes from very warm to lethally hot. Of course, the golems are completely unaffected.";
	
begintalknode 13;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Suddenly, some sort of safety mechanism kicks in. The golems have drawn so much power that the rest of the defenses in the complex are at risk.";
	text2 = "The golems turn and head back to their starting points. The room cools down. You hear clicks coming from the southeast door.";
	
begintalknode 14;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Sss'Arto seems stunned that the victory has been won. _This is a glorious day. Now I must find a way to return and report our victory. Soon, I will slip out to the west and find my way back to Gazaki-Uss. I thank you._";
	
begintalknode 15;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Your blows have knocked a chunk of stone off of the golem. It falls to the ground, and, to your surprise and disgust, begins to writhe and shift. The rock of its body is infused with essence.";
	text2 = "In moments, the stone has changed into flesh, a vague, maggot-like parody of life. One part of the little creature remains stone: its sharp, jagged teeth.";
	
begintalknode 16;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The trall golem has been heavily damaged. It turns and walks off. As it does, it opens its mouth. A shrill, hideous sound comes out.";
	text2 = "The screech burrows deep in your brain, filling you with horror and making it impossible to concentrate.";
	
begintalknode 17;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The trall golem steps onto a Shaping platform. Instantly, a burst of power flows out of the nearby power spiral, through the conduits, and into the creature.";
	text2 = "There is a popping sound and a puff of smoke. Nothing else happens. The golem shifts from foot to foot. The simple creation inside it is confused. Then the golem turns and lumbers toward you.";
	text3 = "As you watch in horror, the golem is restored by the power flow. The cracks in its surface are mended, and it is ready to return itself to the fray.";
	text4 = "You note, however, that the spiral is less bright than it was before. The golem won't be able to heal itself many more times.";
	text5 = "Instead of the restoring flow of energy the golem expects, there is a shower of sparks and a blast of lightning. The golem's body shudders. Cracks appear all over its skin, and sickly green goo leaks out.";
	text6 = "The thing is falling apart before your eyes.";
	text7 = "There is a popping sound and a cloud of smoke. The light in the spiral is definitely flickering now.";
	code =
		clear_strings();
		as(1);
		if (gf(57,8) == 1) {
			as(2);
			sf(57,9,1);
			}
			else if (gf(57,8) == 0) {
				as(3);
				inc_flag(57,10,1);
				if (gf(57,10) > 3)
					as(7);
					else if (gf(57,10) > 1)
						as(4);	
				}
				else {
					as(5);
					as(6);
					sf(57,9,2);
					}
	break;
	
begintalknode 18;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The trall golem has taken too much damage. The protective runes on its body fade away. It crumbles. The stone shell falls apart, and green goo splashes all over the floor.";
	text2 = "It is disgusting.";
	
begintalknode 19;
	state = -1;
	nextstate = -1;
	condition = gf(100,15) == 0 && gf(57,11) > 0;
	question = "special";
	text1 = "The western door opens, enabling you to emerge into a tunnel at the far side of the complex. Looking ahead to the west, you can see the faint glimmer of daylight.";
	text2 = "You are almost to the end. You have successfully cleared a path through the mountains.";
	action = SET_SDF 100 15 1;
	code =
		award_party_xp(100,25);
	break;
	
begintalknode 20;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "";

	
//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Sss'Arto";
	text1 = "There is a drayk hiding in the corner of this disused storeroom. She seems to be recovering from her wounds.";
	text2 = "The whole right side of her body has been scorched by a blast of energy. The well-chewed bones on the floor around her tell you how her food supply is holding out.";
	text3 = "She stands and lets out a weak hiss when she sees you. _Ahssss ... I am Sss'Arto, of the court of Ghaldring. If you come to destroy me, beware. Power still remains to me._";
	text5 = "Sss'Arto watches you warily from the corner. Though her wounds are clearly quite painful, she is far from helpless.";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = -1;
	condition = gf(57,26) == 0;
	question = "Ahhhh! A drayk! Die! Die! Die!";
	text1 = "She braces herself and takes a deep breath. The blast of fire is soon to follow ...";
	action = END_TALK;
	code =
		set_attitude(62,10);
	break;
	
begintalknode 32;
	state = 30;
	nextstate = -1;
	condition = gf(57,26) == 0;
	question = "I sympathize with the rebels. You are safe from me.";
	text1 = "She nods. _I am pleased to hear it. I hope you can succeed where I have failed._";
	action = SET_SDF 57 26 1;
	
begintalknode 33;
	state = 30;
	nextstate = -1;
	condition = gf(57,26) == 0;
	question = "I mean you no harm. I am simply exploring.";
	text1 = "_Hehhhh ... Exploring? Just out for a leisurely walk? Nobody comes here by mistake. But, if you will not harm me, I will respect your privacy._ She chuckles. Then she winces, as the movement aggravates her burns.";
	action = SET_SDF 57 26 1;

begintalknode 34;
	state = 30;
	nextstate = -1;
	condition = gf(57,26) > 0;
	question = "How did you get that wound?";
	text1 = "_I strayed too close to a wingbolt. I fled. It gave chase. It did not live long. The others, simple creatures, did not think to hunt me._";
	text2 = "_The wingbolt has, at least, repaid me with sustenance._ She points at the gnawed bones.";

begintalknode 35;
	state = 30;
	nextstate = 31;
	condition = gf(57,26) > 0;
	question = "Why are you here?";
	text1 = "_I was hunting the wastelands, looking for Shaper infiltrators. I decided to look for a rumored tunnel. A hidden path past the Shaper forts._";
	text2 = "_I sensed the concealment for this complex. I came through and was trapped within._";

begintalknode 36;
	state = 30;
	nextstate = -1;
	condition = gf(57,26) > 0 && gf(57,4) == 0;
	question = "Can you help me to get through here?";
	text1 = "She thinks about it. _Perhaps. I can't pass the field of traps to the south. Perhaps, if you find a way through and find a foe I can aid you against, I might be able to aid you._";

begintalknode 37;
	state = 30;
	nextstate = -1;
	condition = gf(57,26) > 0 && gf(57,11) > 0;
	question = "Can you help me to get through here?";
	text1 = "You describe your travels through the tunnel and tell about your battle against the golem. The drayk says, _I think that we are victorious. You don't need any more aid. Soon, I will slip out. Thank you._";

begintalknode 38;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "You can escape now.";
	text1 = "She shakes her head. _No. That would be cowardice. I will recover, and I will explore more. So close to something that could be of such a help to the rebellion, my honor demands it._";

begintalknode 39;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "You think this tunnel leads past the mountains?";
	text1 = "_I believe it does. That is why the Shapers constructed such powerful defenses. And, when we find a way past it, we can slip through a raiding force and do great harm to them._";

begintalknode 40;
	state = 30;
	nextstate = 32;
	condition = gf(57,26) > 0 && gf(57,4) > 0 && gf(57,11) == 0 && gf(57,27) == 0;
	question = "I want you to help me to fight a golem.";
	text1 = "You describe the golem to Sss'Arto. For a moment, you see the look of fear in her eyes. _That sounds like a terrible guardian. I may not be able to aid you against it._ She looks at the horrible burns on her side.";
	text2 = "_I might be able to advise you, though._";

begintalknode 41;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "What is your advice?";
	text1 = "_Golems are part flesh, part machinery. It sounds like it will draw power from the Shaper workshop around it. Perhaps, if you look for where it draws power, you can find a weakness._";

begintalknode 42;
	state = 32;
	nextstate = -1;
	condition = gf(57,21) == 0 || gf(57,19) == 0;
	question = "I need you to help me to fight it.";
	text1 = "_From what you tell me, it sounds like the route to it is still blocked by traps. Clear them away, and I can help._";

begintalknode 43;
	state = 32;
	nextstate = -1;
	condition = gf(57,21) > 0 && gf(57,19) > 0 && get_stat(20) < 9;
	question = "The path between you and the golem is clear. I need you to help me to fight it.";
	text1 = "You try to convince Sss'Arto to help you, but she is too weak and tired. _Maybe soon, I will recover and explore more. I am not able to fight a creature like that. Not yet._";
	text2 = "_Excuse me. I need to rest. Soon ... Soon I will go._";
	action = END_TALK;

begintalknode 44;
	state = 32;
	nextstate = 30;
	condition = gf(57,21) > 0 && gf(57,19) > 0 && get_stat(20) >= 9;
	question = "The path between you and the golem is clear. I need you to help me to fight it.";
	question = "The path between you and the golem is clear. I need you to help me to fight it.";
	text1 = "You try to convince Sss'Arto to help you. She is desperately weak and tired, but you stir her with tales of victory. Eventually, she nods.";
	text2 = "_Yes, with your help, I might be able to slow it down. Maybe even give you time to hunt its workshops for a weakness._";
	text3 = "_I think I am strong enough to fight. Tell me when you are ready._";
	code =
		sf(57,27,1);
		award_party_xp(150,20);
	break;
	
begintalknode 45;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "Just stay here and recover, then.";
	text1 = "_Yes. Soon, I will explore. That is what honor commands. But fighting that ... No, not yet._";
	action = END_TALK;
	
begintalknode 46;
	state = 30;
	nextstate = -1;
	condition = gf(57,27) == 1;
	question = "I am ready. Go fight the golem.";
	text1 = "_I am going now. I will be slow, but try to keep up. I will not stand long against the golem without your help._ You can see, looking at her face, that she doesn't think she'll survive.";
	text2 = "_If you get the chance, search its workshop. See if you can find a weakness._";
	text3 = "She stands up, takes a last bite of meat, and walks slowly to the south.";
	action = END_TALK;
	code =
		sf(57,27,2);
	break;
	
begintalknode 47;
	state = 30;
	nextstate = -1;
	condition = gf(57,27) == 1;
	question = "I'm not ready to attack yet. Stay here.";
	text1 = "Sss'Arto nods, relieved to hear it. She takes a bite of meat and lies down.";
	action = END_TALK;
	
begintalknode 48;
	state = 30;
	nextstate = -1;
	condition = gf(57,26) > 0;
	question = "Just stay here and recover, then.";
	text1 = "_Yes. Soon, I will explore. That is what honor commands. But ... Not yet._";
	action = END_TALK;
	
	
//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode 51;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

	
begintalknode 52;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 53;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 54;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 55;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 56;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 57;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
	
begintalknode 58;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 59;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 60;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 61;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 62;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 63;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

begintalknode 64;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";

//

begintalknode 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = "You examine this crystal spiral. Conduits draw power from it and flow to the Shaping platform to the south. The floor leading up to the platform is heavily scratched and worn. Something large and heavy walks onto it frequently.";
	text2 = "The spiral is still flickering slightly. Your sabotage has not been repaired.";
	text3 = "There is a panel at the base. Opening it, you see a confusing network of wires, crystals, and gears.";
	code =
		if (gf(57,8) == 0)
			rs(2);
	break;
	
begintalknode 71;
	state = 70;
	nextstate = -1;
	condition = gf(57,8) == 0 && get_stat(21) < 7;
	question = "Sabotage the device.";
	text1 = "Unfortunately, there is a lot of power in this spiral. You see no way to safely deactivate it without, most likely, incinerating yourself. You leave it alone.";
	action = END_TALK;

begintalknode 72;
	state = 70;
	nextstate = -1;
	condition = gf(57,8) == 0 && get_stat(21) >= 7;
	question = "Sabotage the device. (Use 2 living tools.)";
	text1 = "You don't have enough living tools.";
	text2 = "Using a pair of living tools, you break several connections. Power will no longer flow smoothly from the spiral to the platform.";
	code =
		if (num_of_item(255) < 2)
			rs(2);
			else {
				rs(1);
				award_party_xp(100,15);
				take_num_of_item(255,2);
				sf(57,8,1);
				}
	break;
	
begintalknode 73;
	state = 70;
	nextstate = -1;
	condition = gf(57,8) < 2 && get_stat(21) >= 12;
	question = "Set the device to destroy anything that steps onto the platform. (Use 4 living tools.)";
	text1 = "You don't have enough living tools.";
	text2 = "Using several living tools, you reverse several crystals and remove several safety mechanisms. Soon, all blocks to the power flow are gone. Anyone who steps on the platform and tries to draw power will get an ugly surprise.";
	action = END_TALK;
	code =
		if (num_of_item(255) < 4)
			rs(2);
			else {
				rs(1);
				award_party_xp(200,25);
				take_num_of_item(255,4);
				sf(57,8,2);
				}
	break;

begintalknode 74;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "Leave the spiral alone.";
	text1 = "You leave the device as it is.";
	action = END_TALK;


//

begintalknode 90;
	state = -1;
	nextstate = 90;
	condition = 1;
	question = "Name";
	text1 = "There is a power spiral here. It seems to have been hooked up to send a constant, low flow of power into the crystal conduits here. The conduits then snake across the floor and disappear into the wall.";
	text2 = "For some reason, no power is coming out. The conduits are dark.";
	text3 = "There is a power spiral here. It is still sending a constant, low flow of power into the crystal conduits.";
	code =
		if (gf(57,14) > 0) {
			rs(1);
			rs(2);
			}
			else rs(3);
	break;

begintalknode 91;
	state = 90;
	nextstate = -1;
	condition = gf(57,14) == 0;
	question = "Turn on the power.";
	text1 = "You get on your knees, open the base of the power spiral, and try to determine why the power flow stopped.";
	text2 = "You very rapidly reach the limits of your knowledge of mechanics. All of the bits of wire and delicate metal parts defeat your comprehension. You get back up.";
	text3 = "You pull out a few sections of wire and reconnect them. You push the gears with your finger to make sure they aren't stuck. You find that someone hurriedly sabotaged this machine.";
	text4 = "It was probably part of the effort to defend these tunnels from intruders. It takes a few minutes, but you repair the machinery and get power flowing again.";
	action = END_TALK;
	code =
		if (get_stat(21) < 10) {
			rs(3); rs(4); rs(5);
			}
			else {
				rs(2);
				sf(57,14,1);
				award_party_xp(100,22);
				}
	break;
	
begintalknode 92;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "Leave it alone.";
	text1 = "Power spirals can explode if not treated properly. You leave it alone.";
	action = END_TALK;
	
		